<template>
  <div class="onmyoji-container">
    <!-- 导航栏 -->
    <nav class="onmyoji-navbar">
      <div class="navbar-content">
        <div class="logo">
          <RouterLink to="/">
            <span class="text-logo">首页</span>
          </RouterLink>
        </div>
        <div class="nav-menu">
          <ul>
            <li v-for="item in menuItems" :key="item.id">
              <a href="#{{ item.id }}" @click="setCurrentMenuItem(item.id)">{{ item.name }}</a>
            </li>
          </ul>
        </div>
        <div class="user-actions">
          <template v-if="isLoggedIn">
            <button @click="goToProfile" class="btn-profile">用户中心</button>
            <button @click="goToRecharge" class="btn-recharge">游戏充值</button>
          </template>
          <template v-else>
            <button @click="isLoginModalOpen = true" class="btn-login">登录</button>
            <button @click="isRegisterModalOpen = true" class="btn-register">注册</button>
          </template>
          <button @click="toggleBgMusic" class="btn-music">
            <svg v-if="!isMusicPlaying" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
              <path d="M12 3v18M19 6v12l-7-6z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
            </svg>
            <svg v-else width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
              <path d="M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2M18 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
            </svg>
          </button>
        </div>
      </div>
    </nav>

    <!-- 主内容区 -->
    <main class="onmyoji-main">
      <!-- 主视觉区域 -->
      <section class="hero-background">
        <div class="hero-overlay"></div>
        <img src="/images/hero-background.svg" alt="阴阳师背景" class="hero-bg-image" />
        <div class="hero-content">
          <div class="character-visual">
            <img src="/images/new-character.svg" alt="待宵姑获鸟" class="character-image" />
          </div>
          <div class="character-info">
              <div class="character-title">阴阳师</div>
              <div class="character-description">
                <div class="description-label">新片判明</div>
                <img src="/images/new-character.svg" alt="待宵姑获鸟" class="character-image-center" />
                <div class="description-label">待宵姑获鸟 | 全新SSR阶式神降临</div>
                <p>暗夜之中，姑获鸟化身为守护孩童的神秘存在，全新SSR阶式神「待宵姑获鸟」即将降临平安京！</p>
              </div>
              <button class="btn-primary" @click="goToGame">立即体验</button>
            </div>
        </div>
      </section>

      <!-- 游戏特色 -->
      <section id="game-benefits" class="features-section">
        <h2 class="section-title">
          <span class="title-decoration">特色玩法</span>
        </h2>
        <div class="features-container">
          <div class="feature-item">
            <div class="feature-icon">
              <img src="/yys-images/feature1.svg" alt="和风世界" />
            </div>
            <h3 class="feature-title">和风世界</h3>
            <p class="feature-desc">平安时代的奇幻世界，百鬼夜行，沉浸式体验日本传统妖怪文化</p>
          </div>
          <div class="feature-item">
            <div class="feature-icon">
              <img src="/yys-images/feature2.svg" alt="百鬼集结" />
            </div>
            <h3 class="feature-title">百鬼集结</h3>
            <p class="feature-desc">超过百种形态各异的式神，收集、培养、组合打造专属阵容</p>
          </div>
          <div class="feature-item">
            <div class="feature-icon">
              <img src="/yys-images/feature3.svg" alt="策略对战" />
            </div>
            <h3 class="feature-title">策略对战</h3>
            <p class="feature-desc">丰富的技能组合与御魂搭配，烧脑策略，公平竞技</p>
          </div>
          <div class="feature-item">
            <div class="feature-icon">
              <img src="/yys-images/feature4.svg" alt="精彩剧情" />
            </div>
            <h3 class="feature-title">精彩剧情</h3>
            <p class="feature-desc">跌宕起伏的主线故事，感人至深的角色传记，探索平安京的秘密</p>
          </div>
        </div>
      </section>

      <!-- 最新活动 -->
      <section class="events-section">
        <div class="events-header">
          <h2 class="section-title">
            <span class="title-decoration">最新活动</span>
          </h2>
          <a href="#" class="view-more">查看更多</a>
        </div>
        <div class="events-container">
          <div class="event-card">
            <img src="/images/event-banner.svg" alt="活动海报" class="event-image" />
            <div class="event-info">
              <h3 class="event-title">待宵夜话</h3>
              <p class="event-date">2023.12.25 - 2024.01.15</p>
              <button class="btn-secondary">了解详情</button>
            </div>
          </div>
          <div class="event-card">
            <img src="/yys-images/yys-main1.svg" alt="活动海报" class="event-image" />
            <div class="event-info">
              <h3 class="event-title">冬日祭典</h3>
              <p class="event-date">2023.12.20 - 2024.01.10</p>
              <button class="btn-secondary">了解详情</button>
            </div>
          </div>
          <div class="event-card">
            <img src="/yys-images/yys-main2.svg" alt="活动海报" class="event-image" />
            <div class="event-info">
              <h3 class="event-title">新式神召唤</h3>
              <p class="event-date">2023.12.25 - 2024.01.05</p>
              <button class="btn-secondary">了解详情</button>
            </div>
          </div>
        </div>
      </section>

      <!-- 精彩视频 -->
      <section class="video-section">
        <h2 class="section-title">
          <span class="title-decoration">精彩视频</span>
        </h2>
        <div class="video-container">
          <video controls poster="/images/hero-background.svg">
            <source src="/videos/onmyoji_shikigami_1.mp4" type="video/mp4">
            您的浏览器不支持视频播放
          </video>
        </div>
      </section>

      <!-- 页脚 -->
      <footer class="onmyoji-footer">
        <div class="footer-content">
          <div class="footer-logo">
          <span class="text-logo">首页</span>
        </div>
          <div class="footer-links">
            <a href="#">游戏官网</a>
            <a href="#">客服中心</a>
            <a href="#">关于我们</a>
            <a href="#">隐私政策</a>
          </div>
          <p class="copyright">版权所有 © 1997-2023 网易公司 版权所有</p>
          <p class="icp-info">网络游戏出版物号：ISBN 978-7-900419-79-8</p>
        </div>
      </footer>
    </main>

    <!-- 登录弹窗 -->
    <LoginModal
      :is-open="isLoginModalOpen"
      @close="isLoginModalOpen = false"
      @go-to-register="() => { isLoginModalOpen = false; isRegisterModalOpen = true; }"
      @login-success="handleLoginSuccess"
    />
    
    <!-- 注册弹窗 -->
    <RegisterModal
      :is-open="isRegisterModalOpen"
      @close="isRegisterModalOpen = false"
      @go-to-login="() => { isRegisterModalOpen = false; isLoginModalOpen = true; }"
    />
  </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import { RouterLink, useRouter } from 'vue-router'
import LoginModal from '../components/LoginModal.vue'
import RegisterModal from '../components/RegisterModal.vue'

const router = useRouter()

// 用户登录状态
const isLoggedIn = ref(false)
const currentUser = ref(null)

// 菜单数据
const menuItems = [
  { id: 'game-benefits', name: '游戏特色' },
  { id: 'shikigami', name: '式神录' },
  { id: 'audio-visual', name: '视听中心' },
  { id: 'player-interaction', name: '玩家社区' }
]

// 控制弹窗显示状态
const isLoginModalOpen = ref(false)
const isRegisterModalOpen = ref(false)
const currentMenuItem = ref('game-benefits')

// 设置当前菜单项
const setCurrentMenuItem = (itemId) => {
  currentMenuItem.value = itemId
}

// 前往游戏中心
const goToGame = () => {
  router.push('/game-center')
}

// 音频控制
const bgMusic = ref(null)
const isMusicPlaying = ref(false)

// 初始化
onMounted(() => {
  checkLoginStatus()
  initializeMediaPlayer()
  // 延迟添加水波纹效果，确保DOM加载完成
  setTimeout(() => {
    addRippleEffect()
  }, 500)
})

// 清理
onUnmounted(() => {
  if (bgMusic.value) {
    bgMusic.value.pause()
    bgMusic.value = null
  }
  // 移除所有水波纹元素
  const ripples = document.querySelectorAll('.onmyoji-container > div[style*="ripple"]')
  ripples.forEach(ripple => ripple.remove())
  // 移除滚动事件监听器
  window.removeEventListener('scroll', handleScroll)
})

// 处理登录成功
const handleLoginSuccess = (userData) => {
  isLoggedIn.value = true
  currentUser.value = userData
  localStorage.setItem('currentUser', JSON.stringify(userData))
}

// 检查用户登录状态
const checkLoginStatus = () => {
  const user = localStorage.getItem('currentUser')
  if (user) {
    isLoggedIn.value = true
    currentUser.value = JSON.parse(user)
  } else {
    isLoggedIn.value = false
    currentUser.value = null
  }
}

// 初始化媒体播放器
const initializeMediaPlayer = () => {
  // 设置背景音乐
  bgMusic.value = new Audio('/music/bgm.mp3')
  bgMusic.value.loop = true
  bgMusic.value.volume = 0.3
  
  // 尝试自动播放背景音乐（可能受浏览器策略限制）
  playBgMusic().catch(err => {
    console.log('自动播放被阻止，用户交互后可手动播放', err)
  })
}

// 播放/暂停背景音乐
const toggleBgMusic = () => {
  if (isMusicPlaying.value) {
    pauseBgMusic()
  } else {
    playBgMusic()
  }
}

// 播放背景音乐
const playBgMusic = async () => {
  if (bgMusic.value) {
    try {
      await bgMusic.value.play()
      isMusicPlaying.value = true
    } catch (err) {
      console.error('无法播放背景音乐:', err)
    }
  }
}

// 暂停背景音乐
const pauseBgMusic = () => {
  if (bgMusic.value) {
    bgMusic.value.pause()
    isMusicPlaying.value = false
  }
}

// 导航到用户中心
const goToProfile = () => {
  router.push('/game-center')
}

// 导航到充值页面
const goToRecharge = () => {
  router.push('/recharge')
}

// 添加水波纹效果
const addRippleEffect = () => {
  const container = document.querySelector('.onmyoji-container')
  if (!container) return
  
  // 为容器添加水波纹背景
  container.style.backgroundImage = `
    radial-gradient(circle at 25% 25%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(212, 175, 55, 0.05) 0%, transparent 50%)
  `
  
  // 创建水波纹元素
  const createRipple = () => {
    const ripple = document.createElement('div')
    ripple.className = 'ripple-effect'
    ripple.style.position = 'absolute'
    ripple.style.borderRadius = '50%'
    ripple.style.background = 'radial-gradient(circle, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.15) 50%, rgba(0,0,0,0) 70%)'
    ripple.style.opacity = '0.2'
    ripple.style.pointerEvents = 'none'
    ripple.style.boxShadow = '0 0 15px rgba(212,175,55,0.15)'
    ripple.style.zIndex = '-1'
    
    // 随机位置和大小
    const size = Math.random() * 300 + 200
    const left = Math.random() * 100
    const top = Math.random() * 100
    const duration = Math.random() * 8 + 12
    
    ripple.style.width = `${size}px`
    ripple.style.height = `${size}px`
    ripple.style.left = `${left}%`
    ripple.style.top = `${top}%`
    ripple.style.transform = 'translate(-50%, -50%) scale(0)'
    ripple.style.animation = `ripple ${duration}s ease-out forwards`
    
    container.appendChild(ripple)
    
    // 动画结束后移除
    setTimeout(() => {
      if (ripple.parentNode) {
        ripple.parentNode.removeChild(ripple)
      }
    }, duration * 1000)
  }
  
  // 添加水波纹动画样式
  if (!document.querySelector('style#ripple-animation')) {
    const style = document.createElement('style')
    style.id = 'ripple-animation'
    style.textContent = `
      @keyframes ripple {
        0% {
          transform: scale(0);
          opacity: 0.7;
        }
        100% {
          transform: scale(2);
          opacity: 0;
        }
      }
    `
    document.head.appendChild(style)
  }
  
  // 定期创建水波纹
  setInterval(createRipple, 2000)
}

// 监听页面滚动，创建水波纹效果
let lastScrollY = 0
const handleScroll = () => {
  const scrollY = window.scrollY
  
  // 当页面滚动时，创建水波纹效果
  if (Math.abs(scrollY - lastScrollY) > 50) {
    const container = document.querySelector('.onmyoji-container')
    if (container) {
      // 创建水波纹
      const ripple = document.createElement('div')
      ripple.className = 'ripple-effect'
      ripple.style.position = 'absolute'
      ripple.style.borderRadius = '50%'
      ripple.style.background = 'radial-gradient(circle, rgba(212,175,55,0.1) 0%, rgba(212,175,55,0.15) 50%, rgba(0,0,0,0) 70%)'
      ripple.style.opacity = '0.2'
      ripple.style.pointerEvents = 'none'
      ripple.style.boxShadow = '0 0 15px rgba(212,175,55,0.15)'
      ripple.style.zIndex = '-1'
      
      // 基于滚动位置的波纹
      const size = Math.random() * 200 + 100
      const left = Math.random() * 100
      const top = (scrollY / document.body.scrollHeight) * 100 + 10
      const duration = Math.random() * 5 + 5
      
      ripple.style.width = `${size}px`
      ripple.style.height = `${size}px`
      ripple.style.left = `${left}%`
      ripple.style.top = `${top}%`
      ripple.style.transform = 'translate(-50%, -50%) scale(0)'
      ripple.style.animation = `ripple ${duration}s ease-out forwards`
      
      container.appendChild(ripple)
      
      // 动画结束后移除
      setTimeout(() => {
        if (ripple.parentNode) {
          ripple.parentNode.removeChild(ripple)
        }
      }, duration * 1000)
    }
  }
  
  lastScrollY = scrollY
}

window.addEventListener('scroll', handleScroll)


</script>

<style scoped>
/* 使用全局CSS变量 - 已在App.vue中定义 */

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Ma Shan Zheng', 'Noto Sans SC', cursive, sans-serif;
  color: var(--text-primary); /* 主体文字使用白色 */
  overflow-x: hidden;
  line-height: 1.6;
  
}

/* 统一所有文本使用游戏特色字体 */
* {
  /* 全局字体设置 - 可在此修改所有文本的字体族 */
  font-family: 'Ma Shan Zheng', 'Noto Sans SC', cursive, sans-serif !important;
  /* 颜色继承自body，但允许具体元素覆盖 */
  color: inherit;
}

/* 背景美化 - 增强背景质感 */
body {
  background: linear-gradient(135deg, #121212 0%, #1a1a2e 100%);
  background-attachment: fixed;
}

/* 主容器 */
.onmyoji-container {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(212,175,55,0.08) 0%, rgba(0,0,0,0) 70%);
}

/* 导航栏 */
.onmyoji-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.9), rgba(26, 26, 46, 0.9));
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--gold-dark);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.navbar-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-logo {
  font-size: 32px;
  font-weight: bold;
  color: var(--purple-light);
  text-decoration: none;
  text-shadow: var(--shadow-purple);
  font-family: 'Ma Shan Zheng', cursive;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  /* 添加文字描边效果 */
  text-stroke: 1px rgba(255, 255, 255, 0.2);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

.text-logo:hover {
  color: var(--blue-light);
  text-shadow: var(--shadow-blue);
  transform: scale(1.05);
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-menu li a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
  padding: 5px 0;
  font-weight: 500;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--blue-light);
}

.nav-menu li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--purple-mid), var(--blue-light));
  transition: width 0.3s ease;
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
  width: 100%;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-profile,
.btn-recharge,
.btn-login,
.btn-register {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 5px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-profile:hover,
.btn-recharge:hover,
.btn-login:hover,
.btn-register:hover {
  background: var(--purple-mid);
  color: #fff;
  border-color: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-music {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-music:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  transform: scale(1.1);
}

/* 主内容区 */
.onmyoji-main {
  margin-top: 70px;
}

/* 主视觉区域 */
.hero-background {
  min-height: 90vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
}

/* 背景图片和叠加层设置 */
.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7; /* 增加背景图片透明度，让背景图更清晰 */
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* 降低叠加层透明度 */
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  padding: 0 30px;
  gap: 50px;
}

.character-visual {
  display: none;
}

.character-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.character-image-center {
  max-width: 320px;
  height: auto;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 10px 35px rgba(212, 175, 55, 0.5));
  margin: 20px auto;
  border: 2px solid var(--gold-primary);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.4);
}

.character-title {
  font-size: 64px;
  font-weight: bold;
  margin-bottom: 20px;
  letter-spacing: 5px;
  /* 添加艺术字效果 - 渐变、发光、描边 */
  background: linear-gradient(45deg, var(--gold-primary), var(--gold-secondary), #ffefd5, var(--gold-primary));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.6);
  text-stroke: 1px rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
  animation: gradientAnimation 8s ease infinite, glow 2s ease-in-out infinite alternate;
}

.character-subtitle {
  font-size: 28px;
  color: var(--silver-light) !important;
  margin-bottom: 30px;
  font-weight: 500;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  letter-spacing: 2px;
}

.character-description {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--gold-primary);
  border-radius: 15px;
  padding: 30px;
  backdrop-filter: blur(15px);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
  max-width: 800px;
  margin: 0 auto;
}

/* 主视觉区域正文字体 - 可修改标签和描述的字体大小 */
.description-label {
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  /* 添加文字渐变效果 */
  background: linear-gradient(45deg, var(--gold-primary), var(--gold-secondary)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.character-description p {
  color: var(--text-secondary) !important;
  font-size: 20px;
  line-height: 2.0;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-mid), var(--blue-mid));
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: fit-content;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--purple-light), var(--blue-light));
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* 游戏特色 */
.features-section {
  
  padding: 120px 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--gold-dark);
  border-bottom: 1px solid var(--gold-dark);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.4);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  z-index: 2;
}

.title-decoration {
  font-size: 48px;
  font-weight: bold;
  letter-spacing: 5px;
  position: relative;
  padding: 0 20px;
  font-family: 'Ma Shan Zheng', cursive;
  /* 艺术字效果 */
  background: linear-gradient(45deg, var(--purple-light), var(--gold-primary), var(--purple-mid));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  text-stroke: 1px rgba(255, 255, 255, 0.3);
  text-shadow: 0 0 20px rgba(138, 43, 226, 0.6), 0 0 30px rgba(212, 175, 55, 0.4);
  animation: gradientAnimation 6s ease infinite, pulse 4s ease-in-out infinite;
}

.title-decoration::before,
.title-decoration::after {
  content: '❖';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-primary);
  opacity: 0.7;
  font-size: 24px;
}

.title-decoration::before {
  left: -30px;
}

.title-decoration::after {
  right: -30px;
}

.features-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding: 0 30px;
  position: relative;
  z-index: 2;
}

.feature-item {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.feature-item:hover {
  transform: translateY(-10px);
  border-color: var(--gold-primary);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.feature-icon {
  margin-bottom: 20px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon img {
  max-height: 100%;
  transition: transform 0.3s ease;
}

.feature-item:hover .feature-icon img {
  transform: scale(1.1) rotate(5deg);
}

/* 游戏特色板块正文字体 - 可修改标题和描述的字体大小 */
.feature-title {
  font-size: 24px;  /* 游戏特色标题字体大小 */
  font-weight: bold;
  color: var(--gold-primary) !important;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.feature-item:hover .feature-title {
  color: var(--gold-secondary) !important;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.7);
}

.feature-desc {
  color: var(--text-secondary) !important;
  font-size: 16px;  /* 游戏特色描述字体大小 */
  line-height: 1.6;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.2);
}

/* 最新活动 */
.events-section {

  padding: 100px 0;
  position: relative;
  border-bottom: 1px solid var(--gold-dark);
}

.events-header {
  max-width: 1200px;
  margin: 0 auto 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
  position: relative;
}

.events-header .section-title {
  margin-bottom: 0;
}

.events-header .view-more {
  position: absolute;
  right: 30px;
}

.view-more {
  color: var(--gold-primary);
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.view-more:hover {
  color: var(--gold-secondary);
  transform: translateX(5px);
}

.view-more::after {
  content: '→';
  font-size: 18px;
}

.events-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 0 30px;
}

.event-card {
  
  border: 1px solid var(--border-color);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.event-card:hover {
  transform: translateY(-10px);
  border-color: var(--gold-primary);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.event-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.event-card:hover .event-image {
  transform: scale(1.05);
}

.event-info {
  padding: 20px;
}

/* 最新活动板块正文字体 - 可修改标题和日期的字体大小 */
.event-title {
  font-size: 24px;  /* 活动标题字体大小 */
  font-weight: bold;
  color: var(--gold-primary) !important;
  margin-bottom: 10px;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.event-card:hover .event-title {
  color: var(--gold-secondary) !important;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.7);
}

.event-date {
  color: var(--bronze-light) !important;
  font-size: 16px;  /* 活动日期字体大小 */
  margin-bottom: 20px;
  text-shadow: 0 0 5px rgba(205, 127, 50, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-secondary:hover {
  background: var(--gold-primary);
  color: #000;
}

/* 精彩视频 */
.video-section {
  
  padding: 100px 0;
  position: relative;
  border-bottom: 1px solid var(--gold-dark);
}

.video-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 30px;
  position: relative;
}

.video-container video {
  width: 100%;
  border-radius: 15px;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* 页脚 */
.onmyoji-footer {
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
  padding: 50px 0;
  border-top: 2px solid var(--gold-primary);
  position: relative;
  overflow: hidden;
  box-shadow: 0 -5px 30px rgba(212, 175, 55, 0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-logo {
  margin-bottom: 30px;
}

.footer-logo .text-logo {
  font-size: 40px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-links a {
  color: var(--silver-light) !important;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.2);
}

.footer-links a:hover {
  color: var(--gold-primary);
}

.copyright,
.icp-info {
  color: var(--text-tertiary) !important;
  font-size: 16px;
  margin-bottom: 10px;
  line-height: 1.8;
  opacity: 0.9;
  text-shadow: 0 0 3px rgba(184, 134, 11, 0.3);
}

/* 水波纹动画 */
@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.2;
  }
  50% {
    opacity: 0.1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* 浮动动画 */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glow {
  from {
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.7), 0 0 40px rgba(212, 175, 55, 0.5);
  }
  to {
    text-shadow: 0 0 40px rgba(212, 175, 55, 0.9), 0 0 60px rgba(212, 175, 55, 0.7), 0 0 80px rgba(212, 175, 55, 0.5);
  }
}

/* 文字呼吸动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.03);
  }
}

/* 渐变动画 */
@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .features-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .events-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-content {
    flex-direction: column;
    text-align: center;
  }
  .character-info {
    align-items: center;
  }
}

@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    height: auto;
    padding: 15px 20px;
  }
  .nav-menu ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
  }
  .user-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  .features-container {
    grid-template-columns: 1fr;
  }
  .events-container {
    grid-template-columns: 1fr;
  }
  .character-title {
    font-size: 48px;
  }
  .character-subtitle {
    font-size: 20px;
  }
  .footer-links {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .navbar-content {
    padding: 10px 15px;
  }
  .text-logo {
    font-size: 24px;
  }
  .nav-menu li a {
    font-size: 16px;
  }
  .character-title {
    font-size: 36px;
  }
  .feature-item,
  .event-card {
    padding: 20px;
  }
  .video-container video {
    border-radius: 10px;
  }
}
</style>